import request from '../utils/request.axios';
import { API } from '../config/API';

// 新增商品类型
export async function addCommodityType(params) {
  return request(`${API}/api/commodity/type`, {
    method: 'POST',
    body: params,
  });
}

// 更新商品类型
export async function updateCommodityType(params) {
  return request(`${API}/api/commodity/type`, {
    method: 'PUT',
    body: params,
  });
}
// 删除商品类型
export async function deleteCommodityType(params) {
  return request(`${API}/api/commodity/type`, {
    method: 'DELETE',
    body: params,
  });
}

// 查询商品种类详情
export async function searchCommodityType(params) {
  return request(`${API}/api/commodity/type`, {
    method: 'GET',
    body: params,
  });
}

// 检索商品种类列表
export async function getCommodityType(params) {
  return request(`${API}/api/commodity/types`, {
    method: 'GET',
    body: params,
  });
}
